home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Grafik / Paint / Perfectpaint / rexx / circle / AnimStar.rx < prev    next >
Encoding:
Text File  |  1999-12-03  |  1.1 KB  |  80 lines

  1. /* Script Rexx
  2.     Make Anim_Star
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.   parse ARG Port x1 y1 r b
  9.     ADDRESS value Port
  10.  
  11.     r2=r/3
  12.     Pi=3.1415926/180
  13.  
  14.     pp_DialogInit 250 85 "*Anim*Star*" 2
  15.         pp_Integer 0 110 5 50 16 "Number*of*Point*" 1 3
  16.         pp_Cycle 1 110 25 100 16 "Option" 1 "Filled|Unfilled" 0
  17.     pp_Dialog
  18.     rc=result
  19.     if rc=0 then
  20.         do
  21.             EXIT
  22.         end        
  23.         
  24.     pp_GetDialog 0
  25.     s0=result
  26.  
  27.     pp_GetDialog 1
  28.     sens=result
  29.  
  30.     pp_CountFrames
  31.     nb=result
  32.     IF nb<2 then DO
  33.         pp_Warn 'Make*an*Anim*first.'
  34.         EXIT
  35.     END    
  36.  
  37.     a=360/s0
  38.     a2=a/2
  39.  
  40.     DO j=0 to 89 by (90/nb)
  41.       co=Cos(j*Pi)
  42.       si=Sin(j*Pi)
  43.         pp_StartPoly
  44.  
  45.       DO i=0 To 359 by a
  46.  
  47.           xx = Sin(i*Pi)*r
  48.         yy = Cos(i*Pi)*r
  49.             x = xx*co-yy*si+x1
  50.             y = xx*si+yy*co+y1
  51.         
  52.             ii=i+a2
  53.           xx = Sin(ii*Pi)*r2
  54.         yy = Cos(ii*Pi)*r2
  55.             x2 = xx*co-yy*si+x1
  56.             y2 = xx*si+yy*co+y1
  57.  
  58.             ii=i-a2
  59.           xx = Sin(ii*Pi)*r2
  60.         yy = Cos(ii*Pi)*r2
  61.             x3 = xx*co-yy*si+x1
  62.             y3 = xx*si+yy*co+y1
  63.         
  64.             pp_AddPoly trunc(x3) trunc(y3)
  65.             pp_AddPoly trunc(x) trunc(y)
  66.             pp_AddPoly trunc(x2) trunc(y2)        
  67.         
  68.         END
  69.  
  70.         IF sens=1 then DO
  71.             pp_EndPoly
  72.         END
  73.         ELSE DO
  74.             pp_EndPolyF
  75.         END
  76.  
  77.         pp_NextFrame
  78.  
  79.     END
  80.